<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- 
1、这个表单的id不能变，固定写成"pagerForm"。
2、input用来隐藏查询条件和分页的信息。当点1页、2页的时候时候，DWZ要将该form中的input数据发送到java端
 -->
<form id="pagerForm" method="post" action="sales/all.do">
	<input type="hidden" name="pageNum" value="${requestScope.count.pageNum}" />
	<input type="hidden" name="numPerPage" value="${requestScope.count.numPerPage}" />
	<input type="hidden" name="name" value="${requestScope.count.name}" />
	<input type="hidden" name="code" value="${requestScope.count.code}" />
	
</form>
<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" action="sales/all.do" method="post">
	<div class="searchBar">
		<table class="searchContent">
			<tr>
				<td>
					活动名字：<input type="text" name="name" value="${requestScope.count.name}"/>
				</td>
				<td>
					活动编号：<input type="text" name="code" value="${requestScope.count.code}"/>
				</td>
			</tr>
		</table>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li>
				
			    
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
		<!-- 增删改查 -->
		<li><a class="add"  href="sales/add.do"  target="dialog" mask="true" title="添加栏" rel="tj"><span>增加</span></a></li>
		<li><a class="delete" href="sales/delete.do" target="selectedTodo" rel="checkcode" title="确定要删除吗?"><span>删除</span></a></li>
		<li class="line">line</li>
		<li><a class="icon" href="sales/export.do" target="dwzExport" targetType="navTab" title="实要导出这些记录吗?"><span>导出EXCEL</span></a></li>
		</ul>
		<!-- 增删改查 结束-->
	</div>
	<!-- 对于活动表里面的内容进行展示 -->
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>
				    <th width="20"></th>
					<th width="20"></th>
					<th>活动序号</th>
					<th>活动名称</th>
					<th>开始时间</th>
					<th>结束时间</th>
					<th>操作员</th>
					<th>活动类型</th>
					<th>活动编号</th>
					<th align="center">操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${requestScope.all}" var="i" varStatus="status">
			<tr>
			            <td>${status.index + 1}</td>   
						<td><input type="checkbox"  value="${i.id}" name="checkcode"></td>
				        <td>${i.id}</td>
						<td>${i.name}</td>
						<td>${i.start_time}</td>
						<td>${i.end_time}</td>
						<td>${i.operator}</td>
						<td><c:if test="${i.type =='0'}">促销活动</c:if>
						<c:if test="${i.type =='1'}">其他</c:if>
						</td>
						<td>${i.code}</td>
						<td><a class="edit" href="sales/update.do?id=${i.id}" target="dialog"><span>修改</span></a></td>
			</tr>
			</c:forEach>
		</tbody>
	</table>
	<!-- 活动内容展示结束 -->
	<!-- 用来绘制分页的界面 -->
	<div class="panelBar">
		<div class="pages">
			<span>每页显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="5">5</option>
				<option value="10">10</option>
				<option value="20">20</option>
			</select>
			<span>条，共${requestScope.count.totalCount}条</span>
		</div>
		<div class="pagination" targetType="navTab" totalCount="${requestScope.count.totalCount}" numPerPage="${requestScope.count.numPerPage}" pageNumShown="5" currentPage="${requestScope.count.pageNum}"></div>
	</div>
	
	
</div>

